package com.zzj.hotel.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zzj.hotel.core.entity.RoomType;
import com.zzj.hotel.dao.RoomTypeDao;
import com.zzj.hotel.service.RoomTypeService;

public class RoomTypeServiceImpl implements RoomTypeService {
	private RoomTypeDao roomTypeDao;
	public RoomTypeDao getRoomTypeDao() {
		return roomTypeDao;
	}

	public void setRoomTypeDao(RoomTypeDao roomTypeDao) {
		this.roomTypeDao = roomTypeDao;
	}

	public RoomType findById(String id) {
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put(RoomType.TYPEID, id);
		return roomTypeDao.selectOne(queryMap);
	}

	public List<RoomType> findAll() {
		return roomTypeDao.selectList(null);
	}

	public void update(RoomType roomType) {
		roomTypeDao.update(roomType);
	}

	public void insert(RoomType roomType) {
		roomTypeDao.insert(roomType);
	}

	public void deleteById(String id) {
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put(RoomType.TYPEID, id);
		roomTypeDao.delete(queryMap);
	}

}
